<template>
  <div>
    <el-card>
      <div slot="header" class="clearfix">
        <span>采购日志</span>
      </div>
      <el-table v-loading="loading" :data="list" row-key="id">
        <el-table-column type="index" label="序号"></el-table-column>
        <el-table-column prop="module" label="日志模块" width="100px"></el-table-column>
        <el-table-column prop="type" label="日志类型" width="100px"></el-table-column>
        <el-table-column prop="content" label="日志内容" align="center"></el-table-column>
        <el-table-column prop="createBy" label="操作人" width="150px"></el-table-column>
        <el-table-column prop="createTime" label="操作时间" width="200px"></el-table-column>
      </el-table>
      <pagination
        v-show="queryParams.total > 0"
        :total="queryParams.total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
    </el-card>
  </div>
</template>

<script>
import { page } from "@/api/prod/log/base";

export default {
  name: "BaseLog",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 表格数据
      list: [],
      // 请求参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        superId: this.$route.query.id,
        // 总数
        total: 0,
      },
    };
  },
  created() {
    this.getList();
  },

  methods: {
    /** 查询采购进程列表 */
    getList() {
      this.loading = true;
      page(this.queryParams).then((response) => {
        this.list = response.data;
        this.queryParams.total = response.info.total;
        this.loading = false;
      });
    },
  },
};
</script>

<style>
</style>